#include "NewsCellTableWidget.h"

NewsCellTableWidget::NewsCellTableWidget(QWidget *parent): QWidget(parent), ui(new Ui::NewsCellTableWidgetClass())
{
	ui->setupUi(this);
	tableWidget = new QTableWidget(this);
	tableWidget->horizontalHeader()->setHidden(true);
	tableWidget->verticalHeader()->setHidden(true);
	tableWidget->setColumnCount(1);

	

}

NewsCellTableWidget::~NewsCellTableWidget()
{
	delete ui;
}

void NewsCellTableWidget::setUi(const QVector<NewsCellWidget*>& qVec)
{
	int n = qVec.size();
	tableWidget->setRowCount(n);
	for (int i = 0; i < n; i++)
	{
		tableWidget->setCellWidget(i, 0, qVec[i]);
	}
	adjustSize();
	tableWidget->setMinimumHeight(500);
	tableWidget->setMaximumHeight(500);
	//tableWidget->setFixedHeight(500);
}
